

import { App,createVNode,VNode,render} from "vue"

import Loading from "./loading.vue"


export default {
    install(app:App){
        // console.log('Loading--->',Loading)
        const vnode:VNode = createVNode(Loading)
        // console.log('vnode---->',vnode)
        // render 第一个参数是vnode 虚拟节点
        // 第二个参数 是挂载的dom节点
        render(vnode,document.body)
        app.config.globalProperties.$$loading = {
            show:vnode.component?.exposed?.show,
            hide:vnode.component?.exposed?.hide
        }
        // vnode.component?.exposed 拿到组件暴露出的方法属性
        // console.log(vnode.component?.exposed)
    }
}